/* 
  Copyright (c) SilverLining 2015
  Date:    2016-1-7
  File:    DebugProvider.h  
  Description: 

*/

#pragma once

namespace SL
{
	namespace M
	{
		namespace Debug
		{
			/// <summary>
			/// Managed interface for ETW routines.
			/// </summary>
			public ref class DebugProvider abstract sealed
			{
			public:

				/// <summary>
				/// The last error code returned for the currently executing thread.
				/// </summary>
				static property int LastHr
				{
					/// <summary>
					/// Return the last error code.
					/// </summary>
					/// <returns>An error code.</returns>
					int get();
					/// <summary>
					/// Set the last error code.
					/// </summary>
					/// <param name="error">An error code.</param>
					void set(int error);
				}

				/// <summary>
				/// Log formatted text to the ETW session.
				/// </summary>
				/// <param name="hr">The error code of the trace.</param>
				/// <param name="Fmt">The format string.</param>
				/// <param name="params">The format parameters.</param>
				static void Log(int hr, System::String^ Fmt, ... array<System::Object^>^ params);
			};
		}
	}
}